package LeetCode.leetcode206reverseList;

public class Review2 {
    public ListNode reverseList(ListNode head) {
        if (head == null || head.next == null) {return head;}
        ListNode l = null, r = head;
        ListNode temp;
        while(r != null){
            temp = r.next;
            r.next = l;
            l = r;
            r = temp;
        }
        return l;
    }
}
